<template>
	<template v-for="item in props.coreshopData" :key="item.id">
		<!-- 轮播图 -->
		<HomeSwiper v-if="item.widgetCode === WidgetCodeEnum.imgSlide" :data="item.parameters"></HomeSwiper>
		<!--分类-->
		<HomeNavBar v-if="item.widgetCode === WidgetCodeEnum.navBar" :data="item.parameters"></HomeNavBar>
		<!--公告-->
		<HomeNoticeBar v-if="item.widgetCode === WidgetCodeEnum.notice" :data="item.parameters"></HomeNoticeBar>
		<!-- 视频 -->
		<HomeVideo v-if="item.widgetCode === WidgetCodeEnum.video" :data="item.parameters"></HomeVideo>
		<!-- 商品组 -->
		<HomeGoods v-if="item.widgetCode === WidgetCodeEnum.goods" :data="item.parameters"></HomeGoods>
		<!-- 商品选项卡 -->
		<HomeGoodsTabBar v-if="item.widgetCode === WidgetCodeEnum.goodTabBar" :data="item.parameters"></HomeGoodsTabBar>
		<!-- 图片 -->
		<HomeImg v-if="item.widgetCode === WidgetCodeEnum.imgSingle" :data="item.parameters"></HomeImg>
		<!--搜索-->
		<HomeSearch v-if="item.widgetCode === WidgetCodeEnum.search" :data="item.parameters"></HomeSearch>
		<!-- 服务商品 -->
		<HomeServiceGood v-if="item.widgetCode === WidgetCodeEnum.service" :data="item.parameters"></HomeServiceGood>
		<!-- 优惠券 -->
		<HomeCoupon v-if="item.widgetCode === WidgetCodeEnum.coupon" :data="item.parameters"></HomeCoupon>
		<!-- 拼团 -->
		<HomePinTuan v-if="item.widgetCode === WidgetCodeEnum.pinTuan" :data="item.parameters"></HomePinTuan>
		<!-- 图组 -->
		<HomeImgWindow v-if="item.widgetCode === WidgetCodeEnum.imgWindow" :data="item.parameters"></HomeImgWindow>
		<!-- 秒杀 -->
		<HomeSeckill v-if="item.widgetCode === WidgetCodeEnum.seckill" :data="item.parameters"></HomeSeckill>
		<!-- 团购 -->
		<HomeGroupPurchase v-if="item.widgetCode === WidgetCodeEnum.groupPurchase" :data="item.parameters">
		</HomeGroupPurchase>
		<!--文本内容-->
		<HomeContent v-if="item.widgetCode === WidgetCodeEnum.content" :data="item.parameters"></HomeContent>
		<!-- 文本域 -->
		<HomeTextarea v-if="item.widgetCode === WidgetCodeEnum.textarea" :data="item.parameters?.value"></HomeTextarea>
		<!--空格-->
		<HomeBlank v-if="item.widgetCode === WidgetCodeEnum.blank" :data="item.parameters"></HomeBlank>
		<!-- 下单记录 -->
		<HomeRecord  v-if="item.widgetCode === WidgetCodeEnum.record" :data="item.parameters"></HomeRecord>
		<!--文章-->
		<HomeArticle v-if="item.widgetCode === WidgetCodeEnum.article" :data="item.parameters"></HomeArticle>
		<!--文章分类-->
		<HomeArticleClassify v-if="item.widgetCode === WidgetCodeEnum.articleClassify" :data="item.parameters">
		</HomeArticleClassify>

		<!--弹窗广告-->
		<!-- <HomeAdpop v-if="item.widgetCode === WidgetCodeEnum.adpop" :data="item.parameters"></HomeAdpop> -->
	</template>
</template>

<script setup lang="ts">
	import { WidgetCodeEnum } from '@/core/enum';
	import type { PageConfigItemsType } from '@/core/models';

	import HomeSwiper from './components/home-swiper/home-swiper.vue';
	import HomeNavBar from './components/home-nav-bar/home-nav-bar.vue';
	import HomeSearch from './components/home-search/home-search.vue';
	import HomeNoticeBar from './components/home-notice-bar/home-notice-bar.vue';
	import HomeCoupon from './components/home-coupon/home-coupon.vue';
	import HomeImg from './components/home-img/home-img.vue';
	import HomeImgWindow from './components/home-img-window/home-img-window.vue';
	import HomeVideo from './components/home-video/home-video.vue';
	import HomeGoods from './components/home-goods/home-goods.vue';
	import HomeGoodsTabBar from './components/home-goods-tab-bar/home-goods-tab-bar.vue';
	import HomePinTuan from './components/home-pinTuan/home-pinTuan.vue';
	import HomeSeckill from './components/home-seckill/home-seckill.vue';
	import HomeGroupPurchase from './components/home-group-purchase/home-group-purchase.vue';
	import HomeContent from './components/home-content/home-content.vue';
	import HomeServiceGood from './components/home-service-good/home-service-good.vue';
	import HomeTextarea from './components/home-textarea/home-textarea.vue';
	import HomeBlank from './components/home-blank/home-blank.vue';
	import HomeRecord from './components/home-record/home-record.vue';
	import HomeArticle from './components/home-article/home-article.vue';
	import HomeArticleClassify from './components/home-article-classify/home-article-classify.vue';
	// import HomeAdpop from './components/home-adpop/home-adpop.vue';

	const props = withDefaults(defineProps<{
		coreshopData : Array<PageConfigItemsType>,
	}>(), {
		coreshopData: () => []
	});
</script>

<style></style>